<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.org/ui">

    <p:ajaxStatus onstart="PF('statusDialog').show();" onsuccess="PF('statusDialog').hide();"/>  

    <p:dialog modal="true" widgetVar="statusDialog" header="#{msg.lb_procesando}"   
              draggable="false" closable="false" appendTo="@(body)">  
        <h:graphicImage library="images" name="ajax-loader.gif"   styleClass="cargandoGif"/>
    </p:dialog> 

</ui:composition>